package com.pxst.et.req;

import com.pxst.annotations.validated.DateValidator;
import com.pxst.annotations.validated.DecimalValidator;
import com.pxst.req.BasePageRsp;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotBlank;
import java.math.BigDecimal;
import java.util.Date;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * @author rj
 * @create 2023-11-03-10:09
 */
@Data
public class NonMerchantStatementReq extends BasePageRsp {

    @ApiModelProperty(value = "银行id")
    private Long bankId;

    @ApiModelProperty(value = "虚拟银行对账单id")
    private Long vbId;

    @ApiModelProperty(value = "账户代码")
    private String accountCode;

    @ApiModelProperty(value = "交易id")
    private String commandId;

    @ApiModelProperty(value = "")
    private String accountNo;

    @ApiModelProperty(value = "交易开始时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date transactionStartDate;

    @ApiModelProperty(value = "交易结束时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date transactionEndDate;

    @ApiModelProperty(value = "币种", required = true)
    @NotBlank(message = "币种不能为空")
    private String currency;

    @ApiModelProperty(value = "交易类型")
    private List<Integer> typeList;

    @ApiModelProperty(value = "交易金额")
    @DecimalValidator
    private List<BigDecimal> amountList;

    @ApiModelProperty(value = "转出")
    @DecimalValidator
    private List<BigDecimal> debitList;

    @ApiModelProperty(value = "转入")
    @DecimalValidator
    private List<BigDecimal> creditList;

    @ApiModelProperty(value = "描述")
    private String description;

    @ApiModelProperty(value = "更新时间（起）")
    private String updatedStartDate;

    @ApiModelProperty(value = "更新时间（讫）")
    private String updatedEndDate;

    @DateValidator
    public Map<String, Object> getDateValidated() {
        Map<String, Object> map = new HashMap<>();
        map.put("class", NonMerchantStatementReq.class.getSimpleName());
        map.put("transactionStartDate", transactionStartDate);
        map.put("transactionEndDate", transactionEndDate);
        map.put("updatedStartDate", updatedStartDate);
        map.put("updatedEndDate", updatedEndDate);
        return map;
    }

}
